package homeWork.two.demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: sfx
 * Date: 2022-11-30
 * Time: 16:41
 */
public class Circle {
    private static final double pai = 3.14;
    private double r;//圆的半径

    public void setR(double r) {
        this.r = r;
    }

    //Area方法->计算面积
    public double getArea(){
        return pai*r*r;
    }
    //getPerimeter
    public double getPerimeter(){
        return 2*pai*r;
    }

}
